'------------------------------'
'   Picasa Webalbums Proxy     '
'        version 2.0           '
'Copyright 2008 Wouter Devinck '
' http://www.wouterdevinck.net '
'------------------------------'
'Remark: the Default.aspx page does NOT contain any HTML

Public Class _Default
    Inherits System.Web.UI.Page

    Const USERNAME As String = "wouter.devinck"

    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim WC As New System.Net.WebClient
        Dim ApiUri As String = "http://photos.googleapis.com/data/feed/api/user/" & USERNAME
        Select Case Request.Params.Get("type")
            Case "album"
                ApiUri &= "/?kind=album"
            Case "photo"
                ApiUri &= "/album/" & Request.Params.Get("album") & "/?kind=photo"
            Case Else
                Response.Write("Error: missing parameter")
                Exit Sub
        End Select
        Try
            Response.Write(WC.DownloadString(ApiUri & "&access=public"))
        Catch
            Response.Write("Error")
        End Try
    End Sub

End Class